//
//  ViewController.m
//  transform
//
//  Created by song on 15/1/3.
//  Copyright (c) 2015年 song. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
 

}

-(void)click:(UIButton *)sender
{
    int tag = sender.tag;
    UIButton *imgbtn = (UIButton *)[self.view viewWithTag:10];
    
    switch (tag) {
        case 1:
            // 在当前的ty 上面向上平移50 ，第二次还是再之前的基础上面 50，所以就不平移了
//            imgbtn.transform =CGAffineTransformMakeTranslation(0, -50);
            imgbtn.transform =CGAffineTransformTranslate(imgbtn.transform, 0, -50);
            break;
        case 2:
            // view 对象的放缩
            imgbtn.transform=CGAffineTransformScale(imgbtn.transform, 1.5, 1.5);
            break;
        case 3:
            // 对象的旋转
            imgbtn.transform = CGAffineTransformRotate(imgbtn.transform, M_1_PI);
            break;
        default:
            break;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
